package com.example.testanimation.graphics.matrix.image;

import android.app.Activity;
import android.graphics.Matrix;
import android.os.Bundle;
import android.view.View;

import com.nova.scenic.projectlibs.widget.baseview.GridEditView;
import com.scenic.rd_android.R;
import com.example.testanimation.graphics.matrix.image.widget.MatrixImageView;

/**
 * Created by scenic on 2015/3/29.
 */
public class TestMatrixActivity extends Activity {
    private GridEditView mGridLayout;
    private MatrixImageView mImageView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_matrix_image_test);
        mGridLayout = (GridEditView) findViewById(R.id.id_gridview);
        mImageView = (MatrixImageView)findViewById(R.id.id_matrix_imageview);
    }

    public void btnChange(View view){
        float[] matrixValue= mGridLayout.getValues();
        Matrix matrix = new Matrix();
        matrix.setValues(matrixValue);
        mImageView.setImageMatrix(matrix);
    }

    public void btnReset(View view){
        mGridLayout.resetEditTextValue();
        btnChange(view);
    }
}